from selenium.webdriver.common.by import By

from base import Base


class Page(Base):
    def tp(self):#第一种定位方法
        loc= (By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.xiachufang:id/item_img").instance(0)')
        ele=self.find_ele(loc)
        return ele
    def sc(self):#第二种定位方法
        loc=(By.ID,'com.xiachufang:id/recipe_bto_nav_bar_collect')
        ele=self.find_ele(loc)
        return ele
    def pl(self):#第三种定位方法
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/recipe_bto_nav_bar_comment"]')
        ele=self.find_ele(loc)
        return ele
    def daya(self):
        loc=(By.ID,'com.xiachufang:id/recipe_detail_follow_btn')
        ele=self.find_ele(loc)
        return ele
    def mls(self):
        loc=(By.XPATH,'//android.widget.ImageView[@resource-id="com.xiachufang:id/iv_marathon_left"]')
        ele=self.find_ele(loc)
        return ele
    def duanyan(self):
        loc=(By.XPATH,'//android.view.View[@text="1130 厨友报名 · 3019 作品"]')
        ele=self.find_ele(loc)
        return ele
    def sou(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        ele=self.find_ele(loc)
        return ele
    def ss(self):#第四种定位方法
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    def an(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.find_ele(loc)
        return ele
    def fh(self):#第五种定位方法
        loc=(By.ACCESSIBILITY_ID,'返回')
        ele=self.find_ele(loc)
        return ele
    def dy(self):
        loc=(By.ID,'com.xiachufang:id/search_suggest_group_1')
        ele=self.find_ele(loc)
        return ele




